<template>
  <div>
    <h5>一般</h5>
    <p>{{ count }}</p>
    <button @click="add">点击</button>

    <hr />
    <h5>对象</h5>
    <p>{{obj.grade}}</p>
  </div>
</template>
<script setup>
import { ref, onMounted,onUpdated } from "vue";
const count = ref(1);
const obj = ref({
  grade:2
})
const add = () => {
  count.value++;
  obj.value.grade = 3
};
onMounted(()=>{
	console.log('onMounted')
})
//监听到页面数据变化执行
onUpdated(()=>{

	console.log('onUpdated')
})
</script>